/**
 * Created by Administrator on 2015/6/2.
 */
exports.getLastTermBySplitter=function(source,splitter){
    if(source!=='' && source!==undefined){
        var result= source.substring(source.lastIndexOf(splitter)+1,source.length);
        return result;
    }
    return source;
};
exports.getCategoryId=function(url){
    if(url!=='' && url!=undefined) {
        var expression = new RegExp(".*g(\\d+).*", "ig");
        var result = expression.exec(url);
        if (result != null && result.length > 1) {
            return result[1];
        }
    }
    return url;
};
exports.getCityPYName = function(url){
    if(url!=='' && url!==undefined){
        return this.getLastTermBySplitter(url.substring(0,url.lastIndexOf("/")),"/");
    }
    return url;
};